Skip to content

Conversation

@liam-mackie
Copy link
Collaborator

When updating a cWSA or WSA, we would get failures due to transition time being missing, as well as problems with conflicts when trying to apply. This PR fixes this by adding retries on conflicts, and by setting the LastTransitionTime properly.

case *agentoctopuscomv1beta1.WorkloadServiceAccountStatus:
s.Conditions = updateCondition(s.Conditions, ConditionTypeReady,
"False", ReasonReconcileFailed, err.Error())
case *agentoctopuscomv1beta1.ClusterWorkloadServiceAccountStatus:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can this be simplified to:

switch any(status).(type) {
case *agentoctopuscomv1beta1.WorkloadServiceAccountStatus,
     *agentoctopuscomv1beta1.ClusterWorkloadServiceAccountStatus:
    status.Conditions = updateCondition(status.Conditions, ConditionTypeReady,
        "False", ReasonReconcileFailed, err.Error())
}

?

Maybe this is code style preference though for readability

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not a blocker though

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I tried to do this, Go couldn't be certain on the type that I was asserting, so Conditions didn't exist 😞

@liam-mackie liam-mackie merged commit fdbdb81 into main Nov 2, 2025
10 checks passed
@liam-mackie liam-mackie deleted the lm/fix-status branch November 2, 2025 23:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants